<template>
  <view class="store">
    <view class="main">
	<view v-for="(item,index) in initData" :key="index">
      <view class="list" @click="go_url(item.id)" >
        <view class="img">
			 <image :src="item.image"   mode="widthFix" style="height: 110px;"/>
          <!-- <image src="/static/img/logo2.png"  mode="widthFix"/> -->
        </view>
        <view class="text">
          <p class="name">{{item.storeName}}</p>
          <p class="site">
           <!-- <image :src="item.image"   mode="widthFix"/> -->
            {{item.storeAddr}}
          </p>
        </view>
      </view>
	  </view>
    </view>
  </view>
</template>
<script>
import { uniIcons } from '@dcloudio/uni-ui';
import store from '../../../servers/my/store.js';
export default {
	components: { uniIcons },
	data() {
		return {
			msg_list: [
				{
					id: 5,
					checked: false
				}
			],
			initData:[],
			compile: false,
			is_go_top: false,
			latitude:'',
			longitude:'',
			is_all: false
		};
	},
	mounted() {
		uni.getLocation({
		    type: 'wgs84',
		    success: function (res) {
				this.latitude=res.latitude;
				this.longitude=res.longitude;
		    }
		});
		this.getDate();
	},
	
	methods: {
		getDate() {
			var obj={latitude:this.latitude,longitude:this.longitude};
		store.initData(obj)
				.then(res => {
					console.log(res.data.records)
					this.initData = res.data.records.map(v => {
						v.image = this.imgCDNUrl + v.doorPhoto;
						return v
						});
						
						
				})
				.catch(err => {
					console.log(new Error('请检查网络后重试'));
				});
		},
		go_url(e) {
			console.log(e)
			uni.navigateTo({
				url:'/pages/shop/my/store_detail?shopstore_detail='+e
			})
			 // this.commonality.route_baling('/pages/shop/my/store_detail','shopstore_detail',e)
		}
	}
};
</script>
<style lang="less" scoped>
.store {
  height: 100%;
  background: #fff;
  .main {
    // position: absolute;
    // top: 80rpx;
    // bottom: 0;
    // width: 100%;
    // overflow: auto;
    padding: 0 20rpx;
    box-sizing: border-box;
    .list {
      padding: 20rpx 0;
      border-bottom: 1rpx solid #eeeeee; /*no*/
      display: flex;
      .img {
        margin-right: 33rpx;
        image {
          width: 218rpx;
          border-radius: 20rpx;
        }
      }
      .text {
        flex: 1;
        position: relative;
        .name {
          font-size: 28rpx;
          color: #000;
        }
        .site {
          position: absolute;
          bottom: 0;
         
          font-size: 26rpx;
          color: #999999;
          image {
            position: absolute;
			top: 5rpx;
            left: 0;
            width: 25rpx;
          }
        }
      }
    }
    .list:nth-last-child(1) {
      border-bottom: none;
    }
  }
}
</style>
